package com.tyk.bookstore.front.member.repository;

import com.tyk.bookstore.front.common.dal.mapper.IMapper;
import com.tyk.bookstore.front.member.model.entity.MemberDo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
/**
 * @author tyk
 * @description 会员管理
 */
@Mapper
public interface MemberRepository extends IMapper<MemberDo> {
    void updatePhoneById(@Param("id") Long id, @Param("phone") String phone);

    void updateEmailById(@Param("id") Long id, @Param("email") String email);

    void updateLoginPasswordById(@Param("id") Long id, @Param("password") String password);

    void updatePaymentPasswordById(@Param("id") Long id, @Param("password") String password);

    void deductAmountById(@Param("id") Long id, @Param("deduction") BigDecimal deduction);

    void increaseAmountById(@Param("id") Long id, @Param("increase") BigDecimal increase);

    String selectPaymentPasswordById(@Param("id") Long id);

    BigDecimal selectAmountById(@Param("id") Long id);

    Long existByPhone(@Param("phone") String phone);

    Long existByEmail(@Param("email") String email);

    String selectPhoneById(@Param("id") Long id);
}
